package com.mpsc.mongodb.provide.controller;

import com.mpsc.mongodb.provide.bean.UserInfoEntity;
import com.mpsc.mongodb.provide.sevice.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userInfo")
@Api(value = "UserInfoController", tags = "用户管理")
public class MongodbController {

    @Autowired
    private UserInfoService userInfoService;

    @PostMapping("/mongodb/user")
    @ApiOperation("保存用户信息")
    public void save(@RequestBody UserInfoEntity user) {
        userInfoService.saveUser(user);
    }
}
